package com.supermarket.manage.provider.instock.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.supermarket.manage.common.dto.home.request.HomeInitParams;
import com.supermarket.manage.common.dto.home.response.TopDto;
import com.supermarket.manage.common.dto.home.response.TrendDto;
import com.supermarket.manage.common.dto.stock.request.InstockPageParams;
import com.supermarket.manage.common.pojo.Instock;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author Faxon
 * @version 1.0
 * @date 2020-03-15 19:05
 **/
@Mapper
public interface InstockMapper extends BaseMapper<Instock> {

    /**
     * 条件分页查询入库单
     *
     * @param params
     * @return
     */
    Page<Instock> getInstockPageList(InstockPageParams params);

    /**
     * 获取入库相关金额
     *
     * @param params
     * @return
     */
    List<TopDto<Integer>> getPurchases(HomeInitParams params);

    /**
     * 获取采购趋势
     *
     * @param params
     * @return
     */
    List<TrendDto> getPurchaseTrend(HomeInitParams params);

    /**
     * 获取前五供应商
     *
     * @param params
     * @return
     */
    List<TopDto<String>> getTopSupplier(HomeInitParams params);

    /**
     * 获取单据列表
     *
     * @param params
     * @return
     */
    List<Instock> getInstockList(InstockPageParams params);

    /**
     * 根据id获取单据信息
     *
     * @param id
     * @return
     */
    Instock getInstockById(String id);
}
